/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 *
 */
package com.google.code.bigyang.buffer;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.LongBuffer;
import java.nio.ShortBuffer;

import com.google.code.bigyang.util.SystemUtils;

public class NioBufferFacade implements NioBuffer {

	private final NioBuffer buffer;
	
	public NioBufferFacade(NioBuffer buffer) {
		this.buffer = buffer;
	}
	
	public Buffer clear() {
		return buffer.clear();
	}

	public boolean hasRemaining() {
		return buffer.hasRemaining();
	}

	public int limit() {
		return buffer.limit();
	}

	public int position() {
		return buffer.position();
	}

	public int capacity() {
		return buffer.capacity();
	}

	public Buffer order(Order order) {
		return buffer.order(order);
	}

	public Order getOrder() {
		return buffer.getOrder();
	}

	public void filp() {
		buffer.filp();
	}
	
	public ByteBuffer buf() {
		return buffer.buf();
	}

	public boolean isDirect() {
		return buffer.isDirect();
	}
	
	public String dump() {
		return buffer.dump();
	}

	public void dump(Appendable out, String indent) throws IOException {
		buffer.dump(out, indent);
		
	}
	
	public String toString() {
		return super.toString()+ SystemUtils.LINE_SEPARATOR +buffer.dump();
	}

	public Buffer wrap(byte[] buf) {
		return buffer.wrap(buf);
	}

	public Buffer wrap(byte[] buf,int offset,int len) {
		return buffer.wrap(buf,offset,len);
	}
	
	public Buffer compact() {
		return buffer.compact();
	}

	public boolean hasArray() {
		return buffer.hasArray();
	}

	public byte[] array() {
		return buffer.array();
	}

	public Buffer free() {
		return buffer.free();
	}

	public boolean isReadOnly() {
		return buffer.isReadOnly();
	}

	
	
	public boolean isAutoExpand() {
		return buffer.isAutoExpand();
	}

	public Buffer setAutoExpand(boolean autoExpand) {
		return buffer.setAutoExpand(autoExpand);
	}

	public Buffer expand(int size) {
		return buffer.expand(size);
	}

	public boolean isAutoShrink() {
		return buffer.isAutoShrink();
	}

	public Buffer setAutoShrink(boolean autoShrink) {
		return buffer.setAutoShrink(autoShrink);
	}

	public Buffer shrink() {
		return buffer.shrink();
	}

	public Buffer mark() {
		return buffer.mark();
	}

	public Buffer reset() {
		return buffer.reset();
	}

	public InputStream asInputStream() {
		return buffer.asInputStream();
	}

	public OutputStream asOutputStream() {
		return buffer.asOutputStream();
	}

	public Buffer putByte(byte b) {
		return buffer.putByte(b);
	}

	public Buffer putByte(int index, byte b) {
		return buffer.putByte(index, b);
	}
	
	public Buffer putBytes(byte[] buf) {
		return buffer.putBytes(buf);
	}
	
	public Buffer putBytes(byte[] buf,int offset,int len) {
		return buffer.putBytes(buf, offset, len);
	}

	public byte getByte() {
		return buffer.getByte();
	}

	public byte getByte(int index) {
		return buffer.getByte(index);
	}

	public Buffer getBytes(byte[] buf) {
		return buffer.getBytes(buf);
	}
	
	public Buffer getBytes(byte[] buf,int offset,int len) {
		return buffer.getBytes(buf, offset, len);
	}	
	
	
	public Buffer putShort(short s) {
		return buffer.putShort(s);
	}

	public Buffer putShort(int index, short s) {
		return buffer.putShort(index, s);
	}

	public short getShort() {
		return buffer.getShort();
	}

	public short getShort(int index) {
		return buffer.getShort(index);
	}

	public Buffer putInt(int i) {
		return buffer.putInt(i);
	}

	public Buffer putInt(int index, int i) {
		return buffer.putInt(index, i);
	}

	public int getInt() {
		return buffer.getInt();
	}

	public int getInt(int index) {
		return buffer.getInt(index);
	}

	public Buffer putLong(long v) {
		return buffer.putLong(v);
	}

	public Buffer putLong(int index, long v) {
		return buffer.putLong(index, v);
	}

	public long getLong() {
		return buffer.getLong();
	}

	public long getLong(int index) {
		return buffer.getLong(index);
	}

	public Buffer putFloat(float f) {
		return buffer.putFloat(f);
	}

	public Buffer putFloat(int index, float f) {
		return buffer.putFloat(index,f);
	}

	public float getFloat() {
		return buffer.getFloat();
	}

	public float geteFloat(int index) {
		return buffer.geteFloat(index);
	}

	public Buffer putDouble(double d) {
		return buffer.putDouble(d);
	}

	public Buffer putDouble(int index, double d) {
		return buffer.putDouble(index, d);
	}

	public double getDouble() {
		return buffer.getDouble();
	}

	public double getDouble(int index) {
		return buffer.getDouble(index);
	}

	public ShortBuffer asShortByte() {
		return buffer.asShortByte();
	}

	public CharBuffer asCharByte() {
		return buffer.asCharByte();
	}

	public IntBuffer asIntBuffer() {
		return buffer.asIntBuffer();
	}

	public LongBuffer asLongBuffer() {
		return buffer.asLongBuffer();
	}

	public FloatBuffer asFloatBuffer() {
		return buffer.asFloatBuffer();
	}

	public DoubleBuffer asDoubleBuffer() {
		return buffer.asDoubleBuffer();
	}

	public ByteBuffer duplicate() {
		return buffer.duplicate();
	}

	public ByteBuffer slice() {
		return buffer.slice();
	}

	public ByteBuffer asReadOnlyBuffer() {
		return buffer.asReadOnlyBuffer();
	}

	public int remaining() {
		return buffer.remaining();
	}
	
	
	
}
